Skip to content

FudeReviewPanelにreviewedなファイルの数を表示する#151

Merged
kyu08 merged 4 commits into
mainfrom
feat/sidepanel-viewed-count
Jun 17, 2026
Merged

FudeReviewPanelにreviewedなファイルの数を表示する#151
kyu08 merged 4 commits into
mainfrom
feat/sidepanel-viewed-count

Conversation

@kyu08

@kyu08 kyu08 commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

概要

FudeReviewPanel(sidepanel)の Files セクションヘッダーに viewed ファイル数を表示する。これまでファイル総数のみ表示されていたヘッダーを Files (Reviewed: 3/10) の形式に変更し、レビュー進捗を一目で把握できるようにした。

Closes #150

変更内容

  • files.lua に純粋関数 count_viewed(viewed_files, changed_files) を追加し、VIEWED 状態のファイル数を算出する
  • sidepanel.luaformat_files_section / format_files_section_treeviewed_count パラメータを追加し、ヘッダーを Files (Reviewed: N/M) 形式に変更
  • render()count_viewed を呼び出し、両フォーマット関数に渡す
  • flat モード・tree モード両方で同じヘッダー形式を使用する

テスト計画

  • 既存テスト全パス (make all)
  • 新規テスト追加: tests/fude/files_spec.lua (count_viewed の6テストケース)
  • 既存テスト更新: tests/fude/sidepanel_spec.lua (ヘッダーフォーマットのアサーション更新 + viewed count 表示のテスト追加)
  • 手動確認: PRを開いた状態で sidepanel を表示し、<Tab> での viewed 切替でヘッダー数値が即座に更新されることを確認

Generated with Claude Code

kyu08 and others added 3 commits June 17, 2026 23:15
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 17, 2026 14:18
@kyu08 kyu08 marked this pull request as ready for review June 17, 2026 14:19
@kyu08 kyu08 requested a review from flexphere as a code owner June 17, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

FudeReviewPanel(sidepanel)の Files セクションに、VIEWED(閲覧済み)ファイル数の進捗を Files (Reviewed: N/M) 形式で表示できるようにする変更です。レビュー時にファイルの進捗状況をパネル上で即座に把握できるようになります。

Changes:

  • files.count_viewed(viewed_files, changed_files) を追加し、VIEWED 状態のファイル数を算出
  • ui/sidepanel.lua の Files ヘッダーを Reviewed: N/M 表示に変更(flat/tree 両対応)
  • 上記に追従するテスト・ヘルプ・開発ドキュメント(CLAUDE.md)を更新

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lua/fude/files.lua VIEWED ファイル数を数える純粋関数 count_viewed を追加
lua/fude/ui/sidepanel.lua Files セクションのヘッダーに Reviewed: N/M を表示し、render で viewed_count を算出して渡す
tests/fude/files_spec.lua count_viewed のテストを追加
tests/fude/sidepanel_spec.lua Files ヘッダーのフォーマット変更に合わせて既存テストを更新・追加
doc/fude.txt :FudeReviewPanel の Files ヘッダー表示仕様を追記
CLAUDE.md ui/sidepanel.lua / files.lua の責務・関数一覧の説明を更新

Comment thread lua/fude/ui/sidepanel.lua
Comment on lines +63 to +67
function M.format_files_section(file_entries, width, format_path_fn, viewed_count)
format_path_fn = format_path_fn or function(p)
return p
end
local lines = { string.format(" Files (%d)", #file_entries), string.rep("─", width) }
local lines = { string.format(" Files (Reviewed: %d/%d)", viewed_count, #file_entries), string.rep("─", width) }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b7b2a74 で修正 — viewed_count = viewed_count or 0 を追加しました

Comment thread lua/fude/ui/sidepanel.lua
Comment on lines +107 to +108
function M.format_files_section_tree(tree_entries, total_file_count, width, viewed_count)
local lines = { string.format(" Files (Reviewed: %d/%d)", viewed_count, total_file_count), string.rep("─", width) }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b7b2a74 で修正 — 同様に nil ガードを追加しました

Comment thread lua/fude/ui/sidepanel.lua
Comment on lines 288 to 290
local scope_lines, scope_hls, scope_count = M.format_scope_section(scope_entries, width)
local viewed_count = files_mod.count_viewed(state.viewed_files, state.changed_files or {})
local file_lines, file_hls, file_count

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b7b2a74 で修正 — viewed_count の算出を if repo_root then ブロック内に移動し、file_entries と同じスコープで算出するようにしました

Comment thread lua/fude/ui/sidepanel.lua Outdated
--- @param file_entries table[] entries from files.build_file_entries
--- @param width number available width in columns
--- @param format_path_fn (fun(s: string): string|nil)|nil formats file path for display (nil = identity)
--- @param viewed_count number number of files with VIEWED state

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b7b2a74 で修正 — count of files with VIEWED state に変更しました

Comment thread lua/fude/ui/sidepanel.lua Outdated
--- @param tree_entries table[] entries from ui.sidepanel.tree.flatten_tree
--- @param total_file_count number total number of changed files
--- @param width number available width in columns
--- @param viewed_count number number of files with VIEWED state

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

b7b2a74 で修正 — 同様に修正しました

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kyu08 kyu08 merged commit 36e5606 into main Jun 17, 2026
9 checks passed
@kyu08 kyu08 deleted the feat/sidepanel-viewed-count branch June 17, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FudeReviewPanel reviewedなファイルの数を表示する

2 participants